﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;

namespace Entity
{
    public class News
    {
        #region[Public Properties]

        public string Id { get; set; }
        public string Name { get; set; }
        public string Tag { get; set; }
        public string Image { get; set; }
        public string File { get; set; }
        public string Content { get; set; }
        public string Detail { get; set; }
        public string Date { get; set; }
        public string Title { get; set; }
        public string Description { get; set; }
        public string Keyword { get; set; }
        public string Priority { get; set; }
        public string Index { get; set; }
        public string Check1 { get; set;}
        public string Check2 { get; set; }
        public string Check3 { get; set; }
        public string Check4 { get; set; }
        public string Check5 { get; set; }
        public string Check6 { get; set; }
        public string Order { get; set; }
        public string Active { get; set; }
        public string GroupNewsId { get; set; }
        public string Lang { get; set; }
        public string Views { get; set; }

        #endregion
        #region[NewsIDataReader]
        public static News NewsIDataReader(IDataReader dr)
        {
            var obj = new News
                          {
                              Id = Convert.ToString(dr["Id"]),
                              Name = Convert.ToString(dr["Name"]),
                              Tag = Convert.ToString(dr["Tag"]),
                              Image = Convert.ToString(dr["Image"]),
                              File = Convert.ToString(dr["File"]),
                              Content = Convert.ToString(dr["Content"]),
                              Detail = Convert.ToString(dr["Detail"]),
                              Date = Convert.ToString(dr["Date"]),
                              Title = Convert.ToString(dr["Title"]),
                              Description = Convert.ToString(dr["Description"]),
                              Keyword = Convert.ToString(dr["Keyword"]),
                              Priority = Convert.ToString(dr["Priority"]),
                              Index = Convert.ToString(dr["Index"]),
                              Check1 = Convert.ToString(dr["Check1"]),
                              Check2 = Convert.ToString(dr["Check2"]),
                              Check3 = Convert.ToString(dr["Check3"]),
                              Check4 = Convert.ToString(dr["Check4"]),
                              Check5 = Convert.ToString(dr["Check5"]),
                              Check6 = Convert.ToString(dr["Check6"]),
                              Order = Convert.ToString(dr["Order"]),
                              Active = Convert.ToString(dr["Active"]),
                              GroupNewsId = Convert.ToString(dr["GroupNewsId"]),
                              Lang = Convert.ToString(dr["Lang"]),
                              Views = Convert.ToString(dr["Views"])
                          };
            return obj;
        }
        #endregion
    }
}
